package com.sumainfor.wx.system.gmio.controller;

import com.sumainfor.common.util.ContextUtils;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.wx.system.gmio.service.WorkbenchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author Meng
 * @ClassName WorkbenchController
 * @date 2019/8/8 10:30
 * @description: TODO 微信服务管家工作台
 */
@RestController
@RequestMapping("/workbench")
public class WorkbenchController {

    @Autowired
    private WorkbenchService workbenchService;

    /**
     * @Description //TODO 获取工作台续租和巡房验房数量
     * @return com.sumainfor.common.util.JsonResult
     * @Param []
     * @Date 2019/8/12 9:44
     **/
    @GetMapping("/getReletAndCheckRoom")
    public JsonResult getReletAndCheckRoom() {

        //获取服务管家sys id
        String userId = ContextUtils.getUserId();
        return JsonResult.success(workbenchService.getReletAndCheckRoom(userId));
    }

    /**
     * @Description //TODO 获取工作台消息通知
     * @return com.sumainfor.common.util.JsonResult
     * @Param []
     * @Date 2019/8/12 10:26
     **/
    @GetMapping("/getRollMessage")
    public JsonResult getRollMessage() {

        String userId = ContextUtils.getUserId();
        return workbenchService.getRollMessage(userId);
    }

    /**
     * @Description //TODO 查询退租待验收列表
     * @return com.sumainfor.common.util.JsonResult
     * @Param [params]
     * @Date 2019/8/12 10:47
     **/
    @GetMapping("/getHouConPactList")
    public JsonResult getHouConPactList(@RequestParam Map<String, Object> params) {

        return workbenchService.getHouConPactList(params);
    }

    /**
     * @Description //TODO 查询新房待验收列表
     * @return com.sumainfor.common.util.JsonResult
     * @Param [params]
     * @Date 2019/8/12 10:50
     **/
    @GetMapping("/getHoDecoratePiList")
    public JsonResult getHoDecoratePiList(@RequestParam Map<String, Object> params) {

        return workbenchService.getHoDecoratePiList(params);
    }
}
